﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using DeyuMvc.Dbs;

namespace DeyuMvc.Models
{
    public class Users
    {
        [DisplayName("工号")]
        [Key]
        [MaxLength(45,ErrorMessage = "工号长度不得超过45位")]
        public string TeacherCode { get; set; }

        [DisplayName("姓名")]
        [Required(ErrorMessage = "请填写姓名")]
        [MaxLength(45, ErrorMessage = "姓名长度不能超过30位")]
        public string TeacherName { get; set; }

        [DisplayName("照片")]
        public string PhotoUrl { get; set; }

        [DisplayName("头像")]
        public string PhotoThumbUrl { get; set; }

        [DisplayName("学科")]
        [Required(ErrorMessage = "请选择学科")]
        public string Xueke { get; set; }

        [DisplayName("年级组")]
        [Required(ErrorMessage = "请选择年级组")]
        public string Nianjizu { get; set; }

        [DisplayName("班级")]
        [Required(ErrorMessage = "请选择班级")]
        public string Banji { get; set; }

        [DisplayName("用户名")]
        [Required(ErrorMessage = "请输入登录用户名")]
        public string UserName { get; set; }

        [DisplayName("密码")]
        [Required(ErrorMessage = "请设置登录密码")]
        public string Password { get; set; }
    }
    public  class UsersBll:DBCommon<Users>
    {
        public override string TableName
        {
            get { return "dy_users"; }
        }

        public override string PrimaryKey
        {
            get { return "TeacherCode"; }
        }

        public override string ConnKey
        {
            get { return "default"; }
        }

        public override string ParaF
        {
            get { return "@"; }
        }
    }
}